#include <stdio.h>
#include <string.h>
#include<unistd.h>
int main()
{
    char* pathname = "log.txt";                                              
    FILE* fp = fopen(pathname,"w");                          
    if(!fp)                                            
    {                                                
         printf("fopen error!\n");
    }                                 
    const char *str = "hello file!\n";
    int count = 10;        
    while(count--)         
    {                                   
         fwrite(str, strlen(str), 1, fp);
    }                      
                                      
    fclose(fp);                      
                              
}
